<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>召唤神龙</title>
  <!--http://www.html5rocks.com/en/mobile/mobifying/-->
  <meta name="viewport"
    content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1" />

  <!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="format-detection" content="telephone=no">

  <!-- force webkit on 360 -->
  <meta name="renderer" content="webkit" />
  <meta name="force-rendering" content="webkit" />
  <!-- force edge on IE -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="msapplication-tap-highlight" content="no">

  <!-- force full screen on some browser -->
  <meta name="full-screen" content="yes" />
  <meta name="x5-fullscreen" content="true" />
  <meta name="360-fullscreen" content="true" />

  <!-- force screen orientation on some browser -->
  <meta name="screen-orientation" content="" />
  <meta name="x5-orientation" content="">

  <!--fix fireball/issues/3568 -->
  <!--<meta name="browsermode" content="application">-->
  <meta name="x5-page-mode" content="app">
  <link rel="stylesheet" type="text/css" href="./style-mobile.css" />
  <link rel="stylesheet" href="./picnic@6.5.5.min.css">
  <style>
    #lt-tools {
      width: 90vw;
      height: 90vh;
      position: fixed;
      top: 5vh;
      left: 5vw;
      background-color: #7bed9f;
      border-radius: 3%;
      padding: 2rem;
      z-index: 10;
      overflow-y: scroll;
      display: flex;
      flex-direction: column;
    }

    #lt-tools::-webkit-scrollbar {
      width: 0 !important
    }

    fieldset {
      border: #fff dashed 2px;
      border-radius: 3%;
      display: flex;
      flex-direction: column;
      padding: 2rem;
      /* align-items: center; */
      justify-content: center;
    }

    legend {
      text-align: left;
    }

    .flex {
      width: 100%;
      margin-left: 0;
    }
  </style>
</head>

<body style="margin: 0; background: #ddd;" align="center">
  <div style="align:center;display: none"><img src="./res/share.png" width="10%" /></div>
  <canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
  <div id="block-Box" style="display:block;width:100%;height:100%;"></div>
  </div> -->
  <div id="loadingText"
    style="width:100%;display: none;text-align:center;position:absolute;top:45%;z-index:2;font-size:20px;color:#f99f0a">
    loading......0%
  </div>
  <div id="splash"></div>
  <div id="loadingImg" style="top:45%;width: 100%;position:absolute; ">
    <img src="res/loading.gif" width="7%" height="7%" />
  </div>
  <div id="lt-tools">
    <button id="start" disabled>原汁原味</button>
    <fieldset>
      <legend>选择出身</legend>
      <div>选择你的身份！</div>
      <div class="flex">
        <select name="level">
          <option value="1">蝌蚪</option>
          <option value="2">青蛙</option>
          <option value="3">乌龟</option>
          <option value="4">金鱼</option>
          <option value="5">鲤鱼</option>
          <option value="6">电鳗</option>
          <option value="7">鲨鱼</option>
          <option value="8">鲸</option>
          <option value="9">蛟</option>
        </select>
      </div>
      <button id="change-myself" disabled>启动</button>
    </fieldset>
    <fieldset>
      <legend>自定义初始敌人</legend>
      <div>确定初始敌人的组成比例，总合需要等于1</div>
      <div class="flex three">
        <div>蝌蚪</div>
        <div>青蛙</div>
        <div>乌龟</div>
        <select name="tadpole">
          <option value="0">0</option>
          <option value="0.1">0.1</option>
          <option value="0.2">0.2</option>
          <option value="0.3">0.3</option>
          <option value="0.4">0.4</option>
          <option value="0.5">0.5</option>
          <option value="0.6">0.6</option>
          <option value="0.7">0.7</option>
          <option value="0.8">0.8</option>
          <option value="0.9">0.9</option>
          <option value="1">1</option>
        </select>
        <select name="frog">
          <option value="0">0</option>
          <option value="0.1">0.1</option>
          <option value="0.2">0.2</option>
          <option value="0.3">0.3</option>
          <option value="0.4">0.4</option>
          <option value="0.5">0.5</option>
          <option value="0.6">0.6</option>
          <option value="0.7">0.7</option>
          <option value="0.8">0.8</option>
          <option value="0.9">0.9</option>
          <option value="1">1</option>
        </select>
        <select name="turtle">
          <option value="0">0</option>
          <option value="0.1">0.1</option>
          <option value="0.2">0.2</option>
          <option value="0.3">0.3</option>
          <option value="0.4">0.4</option>
          <option value="0.5">0.5</option>
          <option value="0.6">0.6</option>
          <option value="0.7">0.7</option>
          <option value="0.8">0.8</option>
          <option value="0.9">0.9</option>
          <option value="1">1</option>
        </select>
      </div>
      <button id="change-init" disabled>启动</button>
    </fieldset>
    <fieldset>
      <legend>上帝视角</legend>
      <label for="normal-speed">
        <div>站得高，看得远</div>
        <input type="checkbox" name="normal-speed" id="normal-speed">
        <span class="checkable">敌人拥有你这个视角应该有的速度正常速度</span>
      </label>
      <button id="god-view" disabled>启动</button>
    </fieldset>
    <fieldset>
      <legend>顺风顺水</legend>
      <div>不会有比你强的存在</div>
      <button id="safe-mode" disabled>启动</button>
    </fieldset>
  </div>
  <script>
    var killAdT = typeof (killads);

    function noAdGoToScene() {
      var GameConfig = __require("GameConfig");
      console.log("IndexMainMangerMaing", GameConfig.launchScene, GameConfig.Bros, GameConfig.caS);
      var launchScene = GameConfig.launchScene;
      var Bros = GameConfig.Bros;
      var caS = GameConfig.caS;
      cc.director.loadScene(launchScene, null,
        function () {
          adCompleteFlag = false;
          if (Bros) {
            // show canvas
            var canvas = document.getElementById('GameCanvas');
            canvas.style.visibility = '';
            var div = document.getElementById('GameDiv');
            if (div) {
              div.style.backgroundImage = '';
            }
          }
          cc.loader.onProgress = null;
          console.log('Success to load scene1Main: ' + launchScene);
        }
      );
    }
  </script>
  <script src="./ltxhhz.js"></script>
  <script src="./src/settings.js" charset="utf-8"></script>
  <script type="text/javascript">
    var preloader;
    var adCompleteFlag = false;
    var resCompleteFlag = false;

    var adEndComplete = false;
    var resEndComplete = false;

    judgeLanTitle();

    function judgeLanTitle() {
      if (window.navigator.language == "zh-CN" || window.navigator.language == "zh-cn") {
        document.title = "召唤神龙";
      } else if (window.navigator.language == "zh-TW") {
        document.title = "召喚神龍";
      } else if (window.navigator.language == "zh-HK") {
        document.title = "召喚神龍";
      } else if (window.navigator.language == "ko-KR") {
        document.title = "신용 소환";
      } else if (window.navigator.language == "ja-JP") {
        document.title = "神竜を召喚する";
      } else if (window.navigator.language == "th-TH") {
        document.title = "เรียกมังกร";
      } else {
        document.title = "Summon the Dragon";
      }
    }

    var loadintT = document.getElementById("loadingText");
    var loadintGif = document.getElementById("loadingImg")
    setTimeout(function () {
      loadintGif.remove();
      loadintT.style.display = ""
      updateLabView(0.1);
    }, 1 * 1000)

    window.timer = null;
    window.tempSeconds = 1;
    window.loadData = {};
    loadData.completedCount = 0;
    loadData.totalCount = 0;

    onload();

    function onload() {
      var winHeight = document.documentElement.clientHeight;
    };
    window.onload = function () {
      document.getElementById("block-Box").style.display = "none";
    }

    function updateLabView(t) {
      if (timer != null) {
        clearInterval(timer);
      }
      timer = setInterval(function () {
        tempSeconds++;
        actualTotal();
        var loadintT = document.getElementById("loadingText")
        if (!loadintT) {
          // clearInterval(timer);
          return;
        }

        loadintT.innerHTML = 'loading......' + parseInt(tempSeconds) + '%';

        switch (tempSeconds) {
          case 20:
            updateLabView(0.2);
            break;
          case 40:
            updateLabView(0.3);
            break;
          case 60:
            updateLabView(0.4);
            break;
          case 96:
            updateLabView(5);
            break;
          case 97:
            updateLabView(10);
            break;
          case 98:
            updateLabView(50);
            break;
          case 99:
            updateLabView(100);
            break;
          default:
            if (tempSeconds >= 80 && tempSeconds < 96) {
              updateLabView(t + 0.1);
            }
            break;
        }
        if (tempSeconds > 100) {
          clearInterval(timer);
          tempSeconds = 100
          loadintT.innerHTML = 'loading......' + parseInt(tempSeconds) + '%';
        }
      }, t * 1000);
    }

    function actualTotal() {
      var percent = parseInt(100 * loadData.completedCount / loadData.totalCount);
      if (percent > tempSeconds && loadData.totalCount > 1) {
        tempSeconds = percent;
      }
    }

    function finishLoad() {
      clearInterval(timer);
      loadintT.innerHTML = 'loading......100' + '%';
      setTimeout(function () {
        loadintT.remove();
      }, 0.1 * 1000);
    }
  </script>
  <script src="./src/settings.js" charset="utf-8"></script>
  <script src="./main.js" charset="utf-8"></script>

  <script type="text/javascript">
    (function () {
      // open web debugger console
      if (typeof VConsole !== 'undefined') {
        window.vConsole = new VConsole();
      }

      var debug = window._CCSettings.debug;
      var splash = document.getElementById('splash');
      splash.style.display = 'block';

      function loadScript(moduleName, cb) {
        function scriptLoaded() {
          document.body.removeChild(domScript);
          domScript.removeEventListener('load', scriptLoaded, false);
          cb && cb();
        };
        var domScript = document.createElement('script');
        domScript.async = true;
        domScript.src = moduleName;
        domScript.addEventListener('load', scriptLoaded, false);
        document.body.appendChild(domScript);
      }

      loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js', function () {
        if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
          loadScript(debug ? 'physics.js' : 'physics-min.js', window.boot);
        } else {
          window.boot();
        }
      });
    })();
  </script>
</body>

</html>